<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="lib/react.js"></script>
    <script src="lib/react-dom.js"></script>
    <script src="lib/browser.js"></script>
</head>
<body>
    

    <div  id="root"></div>

    <script  type="text/babel">


        class  App  extends React.Component{

            constructor(props){
                super(props)

                this.state = {
                    num : 0
                }

            }

            clickFunc(){
                console.log('click')
            }

            increase(){

                console.log(this)
                this.setState({
                    num: this.state.num + 1
                })
            }

            decrease(){
                this.setState({
                    num: this.state.num - 1
                })
            }


            render(){
                return (<div>
                    
                        <h1   onClick={this.clickFunc}> 1711A </h1>
                        

                        <button  onClick={this.increase.bind(this)}> + </button>

                        <h1>{this.state.num}</h1>

                        <button  onClick={this.decrease.bind(this)}> + </button>
                
                    </div>)
            }

        }

        ReactDOM.render(<App/>,document.getElementById('root'))




    </script>
</body>
</html>